package com.heima.apis.wemedia;

import com.heima.model.admin.dtos.ChannelDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmChannel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "leadnews-wemedia", contextId = "channel")
public interface IChannelClient {
    /**
     * channel的保存
     *
     * @param wmChannel
     * @return
     */
    @PostMapping("/api/v1/channel/save")
    ResponseResult save(@RequestBody WmChannel wmChannel);

    /**
     * channel的模糊分页查询
     *
     * @param dao
     * @return
     */
    @PostMapping("/api/v1/channel/list")
    ResponseResult page(ChannelDto dao);

    /**
     * channel的修改
     *
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/channel/update")
    ResponseResult update(@RequestBody WmChannel dto);

    /**
     * 删除channel
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/channel/del/{id}")
    ResponseResult del(@PathVariable("id") Integer id);
}
